package edu.bbu.bibliospring.common.dto;

import java.util.Date;

/**
 * Created by anna on 6/5/14.
 */
public class BorrowingDto extends DataTransferObject {

    private static final long serialVersionUID = 1L;

    private Long id;
    private BookDto book;
    private ProfileDto borrower;
    private LocationDto borrowedFrom;
    private Date borrowedSince;
    private Date borrowedUntil;

    BorrowingDto() {super(BorrowingDto.class.getName());}

    BorrowingDto(String modelClass) {
        super(modelClass);
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public BookDto getBook() {
        return book;
    }

    public void setBook(BookDto book) {
        this.book = book;
    }

    public ProfileDto getBorrower() {
        return borrower;
    }

    public void setBorrower(ProfileDto borrower) {
        this.borrower = borrower;
    }

    public LocationDto getBorrowedFrom() {
        return borrowedFrom;
    }

    public void setBorrowedFrom(LocationDto borrowedFrom) {
        this.borrowedFrom = borrowedFrom;
    }

    public Date getBorrowedSince() {
        return borrowedSince;
    }

    public void setBorrowedSince(Date borrowedSince) {
        this.borrowedSince = borrowedSince;
    }

    public Date getBorrowedUntil() {
        return borrowedUntil;
    }

    public void setBorrowedUntil(Date borrowedUntil) {
        this.borrowedUntil = borrowedUntil;
    }

    @Override
    public String toString() {
        return "BorrowingDto [id=" + this.id + ", book=" + this.book.getTitle() + ", borrower=" + this.borrower.getFirstName() + " " + this.borrower.getLastName()
                + ", borrowedFrom=" + this.borrowedFrom.getLibraryName() + ", borrowedSince=" + this.borrowedSince.toString() + ", borrowedUntil=" + this.borrowedUntil.toString() + "]";
    }
}
